package leetcode;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.stream.Collectors;

/**
 * @author Retain
 * @date 2021/8/31 18:55
 */
public class Pdd {

    /**
     * 1
     * 3 4 1
     * 5 2 3
     * 1 2 9 7
     * @param args
     */
    public static void main(String[] args) throws Exception {
        q2();
    }

    public void q1() throws IOException{
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(reader.readLine());
        int[] n = new int[t];
        int[] m = new int[t];
        int[] k = new int[t];
        List<List<Integer>> reds = new ArrayList<>();
        List<List<Integer>> blues = new ArrayList<>();
        for (int i = 0 ; i < t; i++) {
            String s1 = reader.readLine();
            int[] s = Arrays.stream(s1.split(" ")).mapToInt(Integer::parseInt).toArray();
//            n[i] = s[0];
//            m[i] = s[1];
            k[i] = s[2];
            List<Integer> redInt = Arrays.stream(reader.readLine().split(" ")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());
            reds.add(redInt);
            Collections.sort(redInt);
            String s2 = reader.readLine();
            List<Integer> blueInt = Arrays.stream(s2.split(" ")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());
            blues.add(blueInt);
        }

        for (int i = 0; i < t; i++) {
            int k1 = k[i];
            int score = 0;
            int o = 0;
            List<Integer> red = reds.get(i);
            List<Integer> blue = blues.get(i);
            int n1 = red.size();
            int m1 = blue.size();
            for (int j = 0; j < n1; j++) {
                for (int l = o; l < m1; l++) {
                    if (Math.abs(red.get(j) - blue.get(l)) <= k1) {
                        score++;
                        o++;
                        break;
                    }
                }
            }
            System.out.println(score);
        }
    }

    public static void q2() throws Exception{
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(reader.readLine());
        int[] nums = new int[t];
        for (int i = 0; i < t; i++) {
            nums[i] = Integer.parseInt(reader.readLine());
        }
        for (int num : nums) {
            if (num < 12) {
                System.out.println((num - 1) / 3);
                continue;
            }
            int n = (int) Math.sqrt(num);
            int left = n;
            while (left > 0) {
                double right = (num - n ) / (2 * n + 1.0);
                int preNum = num;
                while (Math.abs(right - (int) right) > 0.01) {
                    preNum--;
                    if (num - preNum > 2) break;
                    right = (preNum - n ) / (2 * n + 1.0);
                }
                if (Math.abs(right - (int) right) < 0.01) {
                    System.out.println(left * (int) right);
                    break;
                }
                left--;
            }


        }

        //
    }
}
